// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Widgets/SCompoundWidget.h"

#define M_PI 3.14159265358979323846
class STextBlock_TextStyleLambda_List;
/**
 * 
 */
class LISTLIBRARY_API SRingGraphList : public SCompoundWidget
{
public:
	SLATE_BEGIN_ARGS(SRingGraphList)
		{
		}

	SLATE_END_ARGS()

	SRingGraphList();
	/** Constructs this widget with InArgs */
	void Construct(const FArguments& InArgs);
	virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
	//更新环形表数据
	void UpdataListData(TMap<FString, int> InListData);
	//更新文本信息
	void UpdataTextInfo(TMap<FString, int> InListData, int AllValue);
	void CleanList();
	//获取距离椭圆圆心半径某个角度的坐标
	/**
	 * @brief 
	 * @param CenterX 圆心X轴坐标
	 * @param CenterY 圆心Y轴坐标
	 * @param Width 椭圆宽
	 * @param Height 椭圆高
	 * @param angle 角度
	 * @param InPoint 返回的坐标点
	 */
	void GetEllipseOuterPoint(float CenterX, float CenterY, float Width,float Height, float angle, FVector2D &InPoint) const;
	//显示装饰圆
	void ShowOtherCircle(bool IsShow);
	//显示文本
	void ShowText(bool IsShow);
public:
	TMap<FString, float> ListData;
	TArray<FLinearColor> ColorS; //用于记录圆环的颜色
	TArray<FString> TextColor; //用于提供文本的颜色
	//圆内信息
	TSharedPtr<STextBlock_TextStyleLambda_List> AllData;
	//字符串常量
	TSharedPtr<STextBlock_TextStyleLambda_List> OtherText;
	
	TSharedPtr<SVerticalBox> ShowInfo;

	//内圆
	TSharedPtr<SImage> NeiYuan;
	//外圆
	TSharedPtr<SImage> WaiYuan;
	
	//内径距离圆心的距离
	int InsideDiameter;
	//圆环的宽度
	int LoopWidth;
	//椭圆的圆心X
	int CenterX;
	//椭圆的圆心Y
	int CenterY;
	//显示信息
	bool ShowTextInfo;
	//清晰度
	float Definition;
};
